# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=libblockdev
pkgver=2.12
pkgrel=1
pkgdesc="A library for manipulating block devices"
arch=('i686' 'x86_64')
url="https://github.com/rhinstaller/libblockdev"
license=('LGPL')
depends=('btrfs-progs' 'dosfstools' 'dmraid' 'gptfdisk' 'libbytesize' 'lvm2' 'mdadm' 'parted'
         'volume_key' 'xfsprogs' 'kmod')
makedepends=('gobject-introspection' 'systemd' 'python')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rhinstaller/libblockdev/archive/$pkgver-1.tar.gz")
sha512sums=('d40ce3ae45edbe2c79fe0c86df8a22982bd94718cf82161ccd5d7759272eba9948d29e6ab26490f7ba8cb3630b0350ee3a659fba7da73056dc123db9c2535b2e')

prepare() {
  sed -i 's/-ldmraid //' $pkgname-$pkgver-1/src/lib/Makefile.am
}

build() {
  cd "$srcdir"/$pkgname-$pkgver-1
  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc --without-lvm_dbus
  make
}

check() {
  cd "$srcdir"/$pkgname-$pkgver-1
  make check
}

package() {
  cd "$srcdir"/$pkgname-$pkgver-1
  make DESTDIR="$pkgdir" install
}
